package com.usian.admin.feign;

import com.usian.model.article.pojos.ApArticle;
import com.usian.model.article.pojos.ApArticleConfig;
import com.usian.model.article.pojos.ApArticleContent;
import com.usian.model.article.pojos.ApAuthor;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "article")
public interface ApArticleFeign {

    @PostMapping("/api/v1/article/save")/*保存ap端文章表*/
    public ApArticle saveArticle(@RequestBody ApArticle apArticle);

    @PostMapping("/api/v1/article_config/save")/*保存ap端文章配置表*/
    public ResponseResult saveArticleConfig(@RequestBody ApArticleConfig apArticleConfig);

    @PostMapping("/api/v1/article_content/save")/*保存ap端文章内容表*/
    public ResponseResult saveArticleContent(@RequestBody ApArticleContent apArticleContent);

    @GetMapping("/api/v1/author/findByName/{name}")/*根据自媒体用户表名称查询ap作者*/
    public ApAuthor findByName(@PathVariable String name);

    @GetMapping("/api/v1/article/findArticleById/{id}")/*根据id查询app端文章*/
    public ApArticle findArticleById(@PathVariable Long id);

    @GetMapping("/api/v1/article_content/findContentById/{id}")/*根据id 查询app端文章内容*/
    public ApArticleContent findContentById(@PathVariable Long id);

    @GetMapping("/api/v1/article_config/findConfigById/{id}")/*根据id查询app端文章配置*/
    public ApArticleConfig findConfigById(@PathVariable Long id);

}
